package com.itmo.www;
import java.util.Random;
import java.util.Scanner;

public class rando {
    public static void main(String[] args) {

        //random：调用随机数，包前不包后
        Random r=new Random();
        for (int i=0;i<20;i++)
        {
            int data=r.nextInt(10);
            System.out.println(data);
        }

        //生成1-10之间的随机数
        //1-10=> -1=>(0-9)+1

        Random t=new Random();
        for (int i=0;i<20;i++)
        {
            int data1=t.nextInt(10)+1;
            System.out.println(data1);
        }

        //生成6-20之间的随机数
        //6-20 => -6 =>(0-14)+6
        Random a=new Random();
        for (int i=0;i<20;i++)
        {
            int data2=a.nextInt(15)+6;
            System.out.println(data2);
        }
        //生成65-91之间随机数的大小
        //65-91 => -65 =(0-26)+65
        Random f=new Random();
        for (int i=0;i<10;i++)
        {
            int data3=f.nextInt(27)+65;
            System.out.println(data3);
        }

        Random y=new Random();
        int data5=y.nextInt(10)+1;
        Scanner user=new Scanner(System.in);
        System.out.println("请输入号码");
        while(true)
        {
            int ab=user.nextInt();
            if(ab>data5)
            {
                System.out.println("数字过大");
            }
            else if(ab<data5)
            {
                System.out.println("数字过小");
            }
            else
            {
                System.out.println("正确");
                break;

            }


        }

    }
}
